<?php
 
if(!isset($_SESSION))session_start();
include_once('AbstractDao.php');	
class LoginDAO extends AbstractDao{
	// Construtor
	public function __construct(){ 
		parent::__construct();
	}	
	
public function __login($pUsuario, $pSenha){ # Verifica email e senha
     try{
                $retorno = NULL;	
                $this->__executeSQL("
                        select * from login
                        where usuario = '".$pUsuario."' and senha = '".$pSenha."'
                           
                ");
               
                if($this->__returnLinesSQL() > 0){
                        $retorno[0] = $this->__returnSpecificContentSQL(0, "usuario");
                        $retorno[1] = $this->__returnSpecificContentSQL(0, "senha");
                        $retorno[2] = $this->__returnSpecificContentSQL(0, "tipo");
                }
                $this->__freeMemory();
                return $retorno;

        }catch(Exception $e){
                throw $e;
        }
    }	
}
?>
